import request from '@/utils/request';

export async function queryProvider(params) {
  return request('/api/provider/selectByPage', {
    params,
  });
}
export async function removeProvider(params) {
  return request(`/api/provider/${params.providerId}`, {
    method: 'DELETE',
    data: {  },
  });
}
export async function addProvider(params) {
  return request('/api/provider', {
    method: 'POST',
    data: { ...params },
  });
}
export async function updateProvider(params) {
  return request('/api/provider', {
    method: 'PUT',
    data: { ...params },
  });
}

export async function updateProviderStatus(params) {
  return request(`/api/provider/updateStatus/${params.providerId}/${params.deletedFlag}`, {
    method: 'PUT',
    data: { ...params },
  });
}

export async function queryAllProvider() {
  return request('/api/provider/selectAll', {
    method: 'GET',
    data: {},
  });
}

export async function queryProviderDetail(params) {
  return request(`/api/provider/${params.providerId}`, {
    method: 'GET',
    data: {},
  });
}
